package com.token.service.impl;

import com.google.common.collect.Lists;
import com.token.service.ZipService;
import com.token.utils.ZipFileUtils;
import lombok.SneakyThrows;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @auther: henriy
 * @Date: 2023/12/4
 */
@Service
public class ZipServiceImpl implements ZipService {

    @SneakyThrows(Exception.class)
    @Override
    public void downLoadZip(HttpServletResponse response) {
        String zipFileName = "example.zip";
        List<String> list = Lists.newArrayList();
        list.add("D:\\code\\example\\boot_satoken\\token\\src\\main\\resources\\templates\\outputFile.txt");
        list.add("D:\\code\\example\\boot_satoken\\token\\src\\main\\resources\\templates\\readFile.txt");
        ZipFileUtils.downloadZipFiles(response, list, zipFileName);
    }


}
